﻿@model GameCode.Models.Admin.AdvancedReportModel
@{
    ViewBag.Title = "游戏特权 - 综合统计";
    Model.Caption = "综合统计";
    Layout = "~/Views/Shared/_AdminLayout.cshtml";
}
<script type="text/javascript">
    function submitClick() {
        $("form").submit();
    }
    function exportClick() {
        $("#export").val("True");
        $("form").submit();
    }
    $(document).ready(function () {
        $(".myDatePickerClass").datepicker({
            buttonImage: '@Url.Content("~/Content/image/calendar.gif")',               
            dateFormat: 'yy/mm/dd',                 
            showOn: 'button',               
            buttonImageOnly: true ,
            changeMonth:true,              
            changeYear:true,
        });   
    });
</script>
@using (Html.BeginForm(new { act = "submit" }))
{
    <div class="ui-bar ui-bar-a">
        条件
    </div>
    <div class="ui-body ui-body-a site-content-search">
        @Html.HiddenFor(m => m.IsExport, new { id = "export" })
        <div data-role="fieldcontain">
            @Html.LabelFor(m => m.StartDate)
            @Html.TextBox("StartDate", Model.StartDate.ToString("d"), new { @class = "myDatePickerClass" })
        </div>
        <div data-role="fieldcontain">
            @Html.LabelFor(m => m.EndDate)
            @Html.TextBox("EndDate", Model.EndDate.ToString("d"), new { @class = "myDatePickerClass" })
        </div>
        <div>
            <input type="button" value="统计" data-inline="true" data-mini="true" onclick="submitClick()" />
            <input type="button" value="导出Excel" data-inline="true" data-mini="true" onclick="exportClick()" />
        </div>
    </div>
    if (Model.List != null)
    {
        var grid = new WebGrid(source: Model.List, canPage: false);
    @grid.GetHtml(
        htmlAttributes: new { cellpadding = "0", cellspacing = "0" },
        headerStyle: "ui-li ui-li-divider ui-btn ui-bar-a ui-btn-hover-undefined ui-btn-up-undefined",
    columns: grid.Columns
        (
            grid.Column("日期", "日期"),
            grid.Column("新增用户", "新增用户"),
            grid.Column("活跃用户", "活跃用户"),
            grid.Column("总点击", "总点击"),
            grid.Column("总发码", "总发码")
        )
    )
    }
}